<template>
  <el-table :data="exams" style="width: 100%">
    <el-table-column prop="id" label="ID" width="60"/>
    <el-table-column prop="name" label="考试名称"/>
    <el-table-column prop="start_time" label="开始时间"/>
    <el-table-column prop="end_time" label="结束时间"/>
    <el-table-column label="操作" width="220">
      <template #default="scope">
        <el-button size="mini" @click="view(scope.row)">详情</el-button>
        <el-button size="mini" @click="edit(scope.row)">编辑</el-button>
        <el-button size="mini" type="danger" @click="remove(scope.row)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  data() {
    return {
      exams: [
        { id: 1, name: '期中考试', start_time: '2024-06-01', end_time: '2024-06-02' }
      ]
    }
  },
  methods: {
    view(row) {
      this.$router.push(`/exams/${row.id}`)
    },
    edit(row) {
      this.$router.push(`/exams/edit/${row.id}`)
    },
    remove(row) {
      // 删除逻辑
    }
  }
}
</script> 